<header  id="top" class="header">
<nav role="navigation" class="navbar">
<div class="container">
<div class="row">
  <div class="col-md-12">
	<div class="navbar-header">
      <a href="{{$this->Html->url(Configure::read('Site.logo_url'))}}" class="navbar-brand" style="padding: 24px 15px;">{{$this->Html->image($this->Html->url(Configure::read('Site.logo')), array('style'=>'height:32px;','title' => $site[title],'alt' => $site[title]))}}</a>
    </div>
    	<ul id="login-menus"  class="{{if empty($current_user_id)}}hidden{{/if}} nav navbar-nav pull-right">  
    		
    		<li class="dropdown">
    			<a href="{{$this->Html->url('/shortmessages/mine')}}" class="dropdown-toggle" target="_blank" data-toggle="dropdown" data-container="body" data-placement="bottom" title="站内消息中心"><i class="fa fa-bell"></i><span  class="user-unread-msgnum">0</span></a>
    			<div id="user-unreadmsg-list" class="dropdown-menu user-unreadmsg-list">
					<p>暂无消息</p>
                </div>
    		</li>
			
			<li class="dropdown">
				<a id="vip-user-icon" href="{{$this->Html->url('/users/permission')}}" target="_blank" data-toggle="tooltip" style="  position:absolute;right:0px;top: 0px;z-index: 2; padding: 10px 0;line-height: 1em;{{if !is_array($CurrentUser['role_id']) || max($CurrentUser['role_id'])<=2}}display:none;{{/if}}" data-container="body" data-placement="bottom" title="Vip会员,点击查看权限"><img  style="width: 15px;" src="/img/icons/vip.png"></a>

				 {{$this->Html->link('<span id="login-user-name">'.$CurrentUser['username'].'</span><b class="caret"></b>', '#', array('title' => 'view your account',"class"=>"dropdown-toggle",'style'=>'display: inline-block;padding-left:5px;',"data-toggle"=>"dropdown",'escape'=>false)); }}
				<div id="user-operate-menu" class="dropdown-menu" style="right: 0px;left: auto;width:280px;line-height: 28px;padding: 15px;text-align:center;">
				 	
				 	<div style="display:block;width:100%;text-align: left;border-bottom: 1px solid #eee;padding-bottom: 5px;margin-bottom: 5px;"><a href="javascript:;">您的用户编号：<strong id="login-user-id">{{$CurrentUser['id']}}</strong></a></div>
                    <div style="width:120px;display:inline-block;text-align:left;vertical-align: top;">
                    <ul style="padding: 0;list-style-type: none;">
                    	<li><?php echo $this->Html->link('<i class="fa fa-wechat"></i> 授权公众号', array('controller' => 'wxes','action'=>'mine','plugin' => null ,),array('target'=>'_blank','escape'=>false)); ?></li>
	                    <li><?php echo $this->Html->link('<i class="fa fa-clock-o"></i> 定时群发', array('controller' => 'wx_timing_broads','action'=>'mine','plugin' => null ,),array('target'=>'_blank','escape'=>false)); ?></li>
	                    <li><?php echo $this->Html->link('<i class="fa fa-university"></i> 微活动', array('controller' => 'wx_activities','action'=>'mine','plugin' => null ,),array('target'=>'_blank','escape'=>false)); ?></li>
	                    
	                    <li><?php echo $this->Html->link('<i class="fa fa-pencil"></i> 签名设置', array('controller' => 'signatures','action'=>'mine','plugin' => null ,),array('target'=>'_blank','escape'=>false)); ?></li>
	                    <li><?php echo $this->Html->link(__('<i class="fa fa-lock"></i> '.__('My Permissions')), array('controller' => 'users','action'=>'permission','plugin' => null ),array('target'=>'_blank','escape'=>false)); ?></li>
                    	<li><?php echo $this->Html->link(__('<i class="fa fa-font"></i> '.__('字体设置')), array('controller' => 'user_settings','action'=>'setting','plugin' => null,'?'=>array('type'=>'fonts' )),array('target'=>'_blank','escape'=>false)); ?></li>
                    	<li><?php echo $this->Html->link(__('<i class="fa fa-photo"></i> '.__('水印设置')), array('controller' => 'user_settings','action'=>'setting','plugin' => null),array('target'=>'_blank','escape'=>false)); ?></li>
                    	
	                    </ul>
	                    
                    </div>
                    
				 	<div style="width:100px;display:inline-block;text-align:left;vertical-align: top;">
				 		<ul style="padding: 0;list-style-type: none;">
                    	<li><?php echo $this->Html->link('<i class="fa fa-shopping-cart"></i> '.__('My Orders'), array('controller' => 'orders','action'=>'mine','plugin' => null ,),array('target'=>'_blank','escape'=>false)); ?></li>
	                    <li><?php echo $this->Html->link(__('<i class="fa fa-lock"></i> '.__('申请发票')), array('controller' => 'order_invoices','action'=>'mine','plugin' => null ),array('target'=>'_blank','escape'=>false)); ?></li>
	                    
	                    <li><?php echo $this->Html->link('<i class="glyphicon glyphicon-user"></i> '.__('Edit Profile'), array('controller' => 'users','action'=>'edit','plugin' => null ,),array('escape'=>false,)); ?></li>
						<li><?php echo $this->Html->link('<i class="glyphicon glyphicon-asterisk"></i> '.__('Edit Password'), array('controller' => 'users','action'=>'editpassword','plugin' => null ,),array('escape'=>false)); ?></li>
	                   <li><?php echo $this->Html->link(__('<i class="fa fa-leaf"></i> '.__('My Scores')), array('controller' => 'users','action'=>'score','plugin' => null ),array('target'=>'_blank','escape'=>false)); ?></li>
	                    <li><?php echo $this->Html->link('<i class="fa fa-user"></i> '.__('My Invites'), array('controller' => 'users','action'=>'invite','plugin' => null ,),array('target'=>'_blank','escape'=>false)); ?></li>
						
	                    <li>{{$this->Html->link('<i class="fa fa-sign-out"></i> '.__('Logout'), '/users/logout', array('title' => __('Logout'),'onclick'=>'clearUserCookie();','escape'=>false))}}</li> 
						</ul>
                    </div>
                    
				 	 
                    <!--     {{if (empty($CurrentUser['status']))}}
					<li class="activate link">
							{{eval echo $this->Html->link('<i class="fa fa-envelope"></i> '.__('Activate email'), array(
								'controller' => 'users', 'action' => 'activate'
								),array('target'=>'_blank','escape'=>false)); }}
					</li>
					{{/if}} 
					<li><?php echo $this->Html->link(__('<i class="fa fa-map-marker"></i> '.__('My addresses')), array('controller' => 'orders','action'=>'order_consignee','plugin' => null ),array('target'=>'_blank','escape'=>false)); ?></li>
                      -->   
                </div>
			</li>
			{{if Configure::read('Product.enableShopping')}}
			<li>
			{{$this->Html->link('<i class="glyphicon glyphicon-shopping-cart"></i><span id="shopping-cart-num"></span>','/carts/listcart.html',array('escape'=>false))}}
			</li>
		  {{/if}}
		</ul>
		<ul id="login-links" class="{{if !empty($current_user_id)}}hidden{{/if}} nav navbar-nav pull-right">  
			<li class="dropdown">
    			<a href="{{$this->Html->url('/shortmessages/mine')}}" class="dropdown-toggle" target="_blank" data-toggle="dropdown" data-container="body" data-placement="bottom" title="站内消息中心"><i class="fa fa-bell"></i><span  class="user-unread-msgnum">0</span></a>
    			<div id="user-unreadmsg-list" class="dropdown-menu user-unreadmsg-list">
					<p>暂无消息</p>
                </div>
    		</li>
			<?php $oauthlogin = $this->Hook->call('oauthLoginLink'); ?>
			{{if $oauthlogin}}
				<li class="dropdown">
				{{eval echo $this->Html->link(__('Login').'<b class="caret"></b>', array(				
					'controller' => 'users', 'action' => 'login'				
				),array('onclick'=>"return checkLogin();","class"=>"dropdown-toggle","data-toggle"=>"dropdown",'escape'=>false)); }}
					<ul class="dropdown-menu">
						{{$oauthlogin}}	
					</ul>
				</li>
			{{else}}
				<li>
				{{eval echo $this->Html->link(__('Login'), array(				
					'controller' => 'users', 'action' => 'login'			
				),array('onclick'=>"return checkLogin();")); }}
				</li>
			{{/if}}
			<li>
			{{eval echo $this->Html->link(__('Register'), array(
				'controller' => 'users', 'action' => 'register'
			),array('target'=>'_blank',)); }}
			</li>
			{{if Configure::read('Product.enableShopping')}}
			<li>
			{{$this->Html->link('<i class="glyphicon glyphicon-shopping-cart"></i><span id="shopping-cart-num"></span>','/carts/listcart.html',array('escape'=>false))}}
			</li>
		  {{/if}}
		  </ul>
	   <!-- 
      {{if defined('APPEND_LOCALE_BASE')}}
      	{{$this->Html->link('简体','/../')}}, {{$this->Html->link('繁體','/../zh-tw/')}}
      {{else}}
  		{{$this->Html->link('简体','/')}}, {{$this->Html->link('繁體','/zh-tw/')}}
	  {{/if}}
	  -->   
	<nav class="navbar-collapse bs-navbar-collapse" role="navigation">
	<?php 
		if(empty($top_category_id)) $top_category_id=0;
	echo $this->Section->getNavMenu('Category',
		array(
			'selectedid'=> $top_category_id,
			'ulAttributes'=>array('class'=>'nav navbar-nav pull-right'),
            'defaultClass'=>'ui-state-default',
			'preli'=>'',
			'sufli'=>'',
			'maxdepth' => 2,
			'target' => '_blank',
			'separator' => '',
			'inner_separator' => '',
		),$site_cate_id
	);
	?>
    </nav>
</div></div></div>
</nav>
</header>
